﻿using M_Quality.API.Application.Command.QualitygroupCommand;
using M_Quality.Domain;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.QualitygroupHandler
{
    public class QualitygroupbasckfillCommandHandler : IRequestHandler<QualitygroupbasckfillCommand, Qualitygroup>
    {

        protected readonly IQualitygroupRepository qualitygroupRepository;

        public QualitygroupbasckfillCommandHandler(IQualitygroupRepository qualitygroupRepository)
        {
            this.qualitygroupRepository = qualitygroupRepository;
        }

        public Task<Qualitygroup> Handle(QualitygroupbasckfillCommand request, CancellationToken cancellationToken)
        {
            var id = request.QualitygroupId;
            var res = qualitygroupRepository.GetModelAsync(id);
            return res;
        }
    }
}
